# !/usr/bin/env python
# -*-coding:utf-8 -*-

"""
# Author     ：skyTree
# version    ：python 3.11
# Description：商品分类schemas
"""
from pydantic import BaseModel
from typing import Union, List

from schemas.base import DetailBaseResp, PageResponse


class CategoryAddSchemas(BaseModel):
    name: str
    level: Union[int, None] = None
    pid: Union[int, None] = None


class CategoryEditSchemas(BaseModel):
    id: int
    name: str
    level: Union[int, None] = None
    pid_id: Union[int, None] = None


class CategorySchemas(BaseModel):
    id: int
    name: str
    level: Union[int, None] = None
    pid_id: Union[int, None] = None


class AttrSchemas(BaseModel):
    id: int
    name: str
    val: Union[str, None] = None
    _type: str


class CategoryOutSchemas(BaseModel):
    id: int
    name: str
    level: Union[int, None] = None
    pid_id: Union[int, None] = None
    attrs: Union[List, None] = None


class CategoryResponseSchemas(DetailBaseResp):
    data: CategoryOutSchemas


class CategoryListResponseSchemas(DetailBaseResp):
    data: PageResponse
